<template>
  <view class="poster_page" v-if="visible">
    <image class="new_year" src="../../../static/images/happynewyear.png" mode="widthFix"></image>
    <view class="buttons fs32 fw400" @click="posterClose">收下祝福</view>
  </view>
</template>

<script setup lang="ts">
  import { ref, onMounted } from 'vue'
  const visible = ref(false)
  const emits = defineEmits(['close'])
  const open = () => {
    var posterShow = uni.getStorageSync('posterOver')
    if (!posterShow || posterShow != 2025) {
      visible.value = true
      uni.hideTabBar()
    }
  }
  const posterClose = () => {
    uni.setStorageSync('posterOver', 2025)
    visible.value = false
    emits('close', 1)
    uni.showTabBar()
  }
  onMounted(() => {})
  defineExpose({
    open,
    // refreshTips,
  })
</script>

<style lang="scss" scoped>
  .poster_page {
    position: fixed;
    z-index: 99;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    .new_year {
      width: 602rpx;
      height: 896rpx;
    }
    .buttons {
      width: 280rpx;
      height: 72rpx;
      line-height: 72rpx;
      color: #ffffff;
      text-align: center;
      background-image: linear-gradient(to right, #ffb700, #ff4500);
      margin-top: 66rpx;
      border-radius: 100rpx;
    }
  }
</style>
